#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QWidget>
#include <QEvent>
#include <QLabel>

#include <QKeyEvent>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QTimerEvent>
namespace Ui {
class MainWidget;
}

class MainWidget : public QWidget
{
    Q_OBJECT

public:
    explicit MainWidget(QWidget *parent = 0);
    ~MainWidget();

private:
    QLabel *label;
    Ui::MainWidget *ui;
    int timerID1;
    int timerID2;
    //    鼠标事件
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseDoubleClickEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    //   键盘事件
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);
    //    绘图事件
    void paintEvent(QPaintEvent *event);
    void timerEvent(QTimerEvent *event);
    //    所有事件处理
    bool event(QEvent *event);
};

#endif // MAINWIDGET_H
